package com.boss.salary.service;

import com.boss.common.entity.PageDTO;
import com.boss.framework.dto.PaginationDTO;
import com.boss.salary.entity.FormulaManage;
import com.boss.salary.entity.SalaryBasedata;
import com.boss.salary.vo.SalaryMonthEndVO;
import com.boss.sys.ca.user.dto.UserDTO;
import com.singularsys.jep.JepException;

import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;

public interface IFormulaManageService {

    /**
     * 查询公式管理页面
     * @param paginationDTO
     * @param queryForm
     * @return
     */
    PageDTO<FormulaManage> getFormulaManagePage(PaginationDTO paginationDTO, String agencyId, Map<String,Object> queryForm);

    /**
     * 获取公式
     * @param agencyId
     * @return
     */
    List<FormulaManage> generateFormula(UserDTO userDTO,String agencyId);

    /**
     * 提交公式
     * @param formulaManage
     */
    void submitFormula(FormulaManage formulaManage) throws NoSuchMethodException, JepException, IllegalAccessException, InvocationTargetException;

    /**
     * 获取单条公式详情
     * @param id
     * @return
     */
    FormulaManage getFormulaDetail(String id);

    /**
     * 获取所有的工资项
     * @param
     * @return
     */
    List<SalaryBasedata> getAllSalary(String province);

    /**
     * 通过id删除公式
     * @param id
     */
    void removeFormulaById(String id);

    /**
     * 通过公式计算
     * @param province
     * @param agencyIds
     * @param salaryMonthEndVOList
     * @return
     */
    List<SalaryMonthEndVO> calculateByFormula(String province, List<String> agencyIds, List<SalaryMonthEndVO> salaryMonthEndVOList) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, JepException;


    /**
     * 复制公式
     * @param formulaManage
     * @param province
     */
    void saveCopyFormula(FormulaManage formulaManage,String province);
}
